<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.d1 {
				width: 200px;
				height: 200px;
				background-color: #0000FF;
			}
			
			.d2 {
				width: 150px;
				height: 150px;
				background-color: darkred;
				position: absolute;
				z-index: 999;
				/* left: 100px; */
				right: 200px;
				top: 100px;
				bottom: 0px;
				/* margin-top: 100px; */
			}
			
			.d3 {
				width: 100px;
				height: 100px;
				background-color: red;
				position: absolute;
			}
			
			.d4 {
				width: 200px;
				height: 200px;
				background-color: #0000FF;
			}
			
			.d5 {
				width: 150px;
				height: 150px;
				background-color: darkred;
				position: relative;
				top: -10px;
			}
			
			.d6 {
				width: 100px;
				height: 100px;
				background-color: red;
			}
			.d7 {
				width: 100px;
				height: 100px;
				background-color: red;
				position: fixed;
				right: 0px;
				top: 0px;
			}
			.d8 {
				width: 1000px;
				height: 100px;
				background-color: greenyellow;
				position: sticky;
				left: 100px;
				top: 100px;
				/* right: 100px; */
				bottom: 100px;
			}
		</style>
	</head>
	<body>
		绝对定位
		<div class="d1">
			
		</div>
		<div class="d2">
			
		</div>
		<div class="d3">
			
		</div>
		<div style="height: 300px;">
			
		</div>
		相对定位
		<div class="d4">
			
		</div>
		<div class="d5">
			
		</div>
		<div class="d6">
			
		</div>
		<div class="d7">
			固定定位
		</div>
		
		<div class="d8">
			粘性定位
		</div>
	</body>
</html>
